package com.colorfruit.admin.pojo.enums;

/**
 * 业务描述：
 *
 * @Auther: chenjiayuan
 * @Date: create in 2018/7/3 09
 * @Description:
 */
public enum ErrorCodeEnum {

    SUCCESS("00000","请求成功"),

    OVER_POWER("00001","越权操作"),

    /**
     * 统一编码，统一管理
     */
    TOKEN_EXPIRED("10000","TOKEN超时"),
    LOGIN_ERROR("10001","登录失败（具体见msg）"),
    RUNTIME_EXCEPTION("10002", "运行时异常"),
    UNKNOW_EXCEPTION("10003", "未知异常"),

    //业务异常 渠道代理 20000 - 29999
    BANK_LINK_NOT_CONFIG("20000", "小财迷银行链接未配置"),
    NO_VALID_USER("20010", "没有有效的用户"),
    BANK_CAN_NOT_ONSHELF("20020","该银行未分配链接,不能上架"),
    LOAN_CAN_NOT_ONSHELF("20021","该贷款产品未分配链接,不能上架"),
    LINK_AUTO_DE_SHELF("20022", "链接被自动下架"),

    LINK_CANT_ALLOCATE("20030","是非默认链接已被分配,不能上架"),

    //业务异常 贷款 30000 - 40000
    NOT_THIS_LOAN_PRODUCT("30000", "没有这个贷款产品"),
    NOT_THIS_LOAN_ORG("30010","没有这个贷款机构"),
    BUSINESS_ID_NOT_NULL("30020", "需要结算的记录的ID不能为空"),
    BANK_ID_NOT_NULL("30030", "银行ID不能为空"),
    LOAN_DATA_CHECK_IMPORTING("30040", "贷款产品正在预导入中,请30秒后刷新再试"),
    LOAN_DATA_IMPORTING("30040", "贷款产品正在导入中,请2分钟后刷新再试"),


    // 对外接口异常
    REQUEST_DATA_IS_NULL("80000","请求数据为空"),

    REQUEST_DATA_PART_ERROR("80010","部分数据不符合要求"),

    REQUEST_DATA_ALL_ERROR("80020","数据不符合要求"),


    //90000+=>异常编码
    SYSTEM_ERROR("90000","系统异常"),

    ACCESS_ERROR("90100","访问异常"),
    PARAM_ERROR("90200","参数异常"),
    DATA_ERROR("90300","数据异常"),

    INS_NAME_ERROR("90400","机构名称已存在"),
    LOAN_NAME_ERROR("90500","贷款名称已存在"),
    LEVEL_ERROR("90600","数据库等级参数不匹配"),
    INSERT_ERROR("90700","插入数据失败"),



    // ********************** 支付相关 *****************************
    RSACHECK_ERROR("10001", "回调验签异常！"),
    APPID_ERROR("10002", "支付appId校验失败"),
    CLOSE_FAILURE("10003", "订单关闭失败"),
    REFUND_FAILURE("10004", "订单退款失败"),
    TCP_EXCEPTION("10005", "通信异常"),
    PAY_EXCEPTION("10006","支付异常"),

    REPEAT_PAYMENT("20001", "订单已支付，请勿重复支付"),
    RECORD_NOEXIST("20002", "支付记录不存在"),
    AMOUNT_ERROR("20003", "支付金额有误"),
    UPDATE_ERROR("20004", "状态更新失败"),
    PAYSTATUS_ERROR("20005", "支付状态错误，请刷新重试！"),


    // ********************** 订单相关 *****************************
    ORDER_NOEXIST("30001", "订单记录不存在"),
    PAYMETHOD_ERROR("30002", "支付方式错误"),
    STATUS_UPDATE_ERROR("30003", "订单状态更新失败"),
    REFUND_UPDATE_ERROR("30004", "退款状态更新失败"),
    REFUND_ERROR("30005", "申请退押金出现异常"),
    DELIVER_ERROR("30006","发货标记失败"),
    REPEAT_MOBILEPHONE("30007","手机号码重复申请"),
    INSUFF_QUANTITY("30008","机具数量不足"),
    MOBILEPHONE_UPDATE_FAILURE("30009","手机号码更新失败"),
    MOBILEPHONE_EXIST("30010","手机号码已存在"),

    // ********************** 产品相关 *****************************
    PRODUCT_NOEXIST("40001", "产品不存在"),
    ILLEGAL_NUMBER("40002", "领取数量错误"),

    // ********************** 贷款非脱敏订单 *****************************
    LOAN_ORDER_UPDATE_ERROR("50001", "贷款非脱敏订单编辑失败！"),
    LOAN_ORDER_DELETE_ERROR("50002", "贷款非脱敏订单删除失败！"),

    LOAN_FILTER_DELETE_ERROR("50003", "该终端数据已存在，不能重复添加！"),
    UPDATE_FILTER_DELETE_ERROR("50004", "修改代理商产品过滤规则失败！"),
    ;

    private String code;
    private String msg;

    ErrorCodeEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
